package com.woniu.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Service;

@Service
public class EmailService {
    @Autowired
    private JavaMailSenderImpl mailSender;

    public void sendSimpleMail(String orderCode,Integer num,String procedure) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom("3088896870@qq.com");
        message.setTo("3088896870@qq.com");
        message.setSubject("上海秋怡电子厂ERP返修申请");
        message.setText(orderCode+" 订单的申请返修,数量为"+num+",返修工序为"+procedure);
        mailSender.send(message);
    }
}
